<div id="main">
	
	<h1><%= l('Mailing') %></h1>

	<table cellpadding="0" cellspacing="0" width="100%s">
		<thead>
  		<tr>
    		<th width="50%"><%= l('SUBJECT') %></th>
    		<th><%= l('RECIPIENTS') %>&nbsp;</th>
    		<th><%= l('ACTIONS') %></th>
  		</tr>
		</thead>
		<tbody>
			<% for mailing in @mailings %>
	  	<tr>
	    	<td><%= link_to mailing.subject, :action => "show", :id => mailing  %></td>
	    	<td><%= mailing.to.split(', ').size %></td>
	    	<td>
	      	<%= link_to l("edit"), :action => "edit", :id => mailing %>
					<%= button_to l("test"), { :action => "test_mailing", :id => mailing } %>
					<%= button_to l("send"), { :action => "send_mailing", :id => mailing }, :confirm => "Are you sure ?" %>
	      	<%= button_to l("delete"), { :action => "delete", :id => mailing }, :confirm => "Are you sure ?" %>
	    	</td>
	  	</tr>
			<% end %>
			<% if @mailings.nil? or @mailings.size == 0%>
			<tr>
				<td colspan="3"><%= l('No mailing') %></td>
			</tr>
			<% end %>
		</tbody>
	</table>

</div>

<div id="sidebar">
	<ul class="button">
		<li><%= link_to l("new mailing"), :action => "new" %></li>
	</ul>
</div>